'''Game main module.

Contains the entry point used by the run_game.py script.
'''

import pygame
from pygame.locals import *
import menus, context, settings, game

def main():
    pygame.display.set_mode(settings.resolution, (FULLSCREEN if settings.fullscreen else 0))
    if settings.quickstart:
        context.push(game.GameContext(settings.quickmap))
    else:
        context.push(menus.MainMenu())

    clock = pygame.time.Clock()    
    while context.top():
        clock.tick(settings.fps)
        context.top().think()

    pygame.quit()

